﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SimpleServiceBus.Bus.MessageManagement;

namespace SimpleServiceBus.Bus.Pipeline.PipelineComponents.MessageFiltering
{
    public class MessageFilterBinding : MessageTypePredicate
    {
        public IMessagePredicate MessageFilter { get; set; }
        public bool AllowMessage(MessageEnvelope message)
        {
            if (MessageFilter == null)
                return true;

            return MessageFilter.Matches(message);
        }
    }
}
